package traditionalthread;

public class ThreadSafeDraw extends Thread{

	private ThreadSafeModel tsf;
	
	private double drawAccount;
	
	public ThreadSafeDraw(String name,ThreadSafeModel tsf, double drawAccount) {
		super(name);
		this.tsf = tsf;
		this.drawAccount = drawAccount;
	}

    public void run(){
    	tsf.draw(drawAccount);
    }

	public static void main(String[] args) {
		ThreadSafeModel tsf = new ThreadSafeModel("demo",1000);
		new ThreadSafeDraw("甲",tsf, 800).start();
		new ThreadSafeDraw("已", tsf, 800).start();

	}

}
